
using System;
using System.Collections.Generic;
using UnityEngine;

namespace HareGame
{
    public partial class DataManager
    {
        [SerializeField]
        private List<TaskData> _TaskDatas = new List<TaskData>();

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns></returns>
        public TaskData GetTaskData(TaskID ID)
        {
            return GetData(ID.ToString(), _TaskDatas);
        }

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <returns></returns>
        public TaskData GetTaskData(string ID)
        {
            return GetData(ID, _TaskDatas);
        }

        /// <summary>
        /// 获取所有数据
        /// </summary>
        /// <returns></returns>
        public List<TaskData> GetAllTaskData()
        {
            return _TaskDatas;
        }

        void InitTaskData()
        {
            _TaskDatas = GameEntry.Util.ReadJsonDataFromStreamAssets<TaskData>("Task");
        }
    }
}
